Validate NCHWc reorder channel layout - #32552
Open
Akshay Sonawane (apsonawane) wants to merge 4 commits into
Open
Akshay Sonawane (apsonawane) wants to merge 4 commits into
Akshay Sonawane (apsonawane) wants to merge 4 commits into
Conversation
Akshay Sonawane (apsonawane)
enabled auto-merge (squash)
September 10, 2026 21:00
Copilot started reviewing on behalf of
Akshay Sonawane (apsonawane)
September 10, 2026 21:01
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The test does not cover the newly added excessive-padding rejection condition.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Strengthens NCHWc ReorderOutput channel-layout validation.
Changes:
- Validates block alignment and requested channel count.
- Adds a rejection test for unaligned input channels.
File summaries
| File | Description |
|---|---|
onnxruntime/contrib_ops/cpu/nchwc_ops.cc |
Enforces valid NCHWc channel padding. |
onnxruntime/test/contrib_ops/nchwc_ops_test.cc |
Tests rejection of unaligned channels. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mirounga
self-requested a review
September 16, 2026 17:12
Add the aligned input case where ReorderOutput receives one complete channel block beyond the requested output channels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Akshay Sonawane (apsonawane)
September 21, 2026 22:15
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The test file has an undeclared variable and mismatched namespace braces that prevent compilation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (1)
Restore the anonymous namespace and the extra-channel-block test setup lost during the main merge, fixing the test translation unit compile errors across CI configurations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Akshay Sonawane (apsonawane)
September 21, 2026 22:31
View session
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This pull request strengthens input validation in the
ReorderOutputoperator for NCHWc tensors and adds a new unit test to ensure correct error handling for misaligned input channels. The main focus is to enforce stricter requirements on input channel alignment and to verify this behavior with automated testing.Operator input validation improvements:
ReorderOutput::Computeinnchwc_ops.ccto enforce that the input channel count is a multiple of the NCHWc block size, and that the number of channels requested is properly aligned. The error message was also improved for clarity.Testing enhancements:
ReorderOutputRejectsUnalignedInputChannelsinnchwc_ops_test.ccto verify that the operator correctly rejects inputs where the channel count is not NCHWc block-aligned, ensuring that the stricter validation is covered.